#include "stdafx.h"

#include "entity\Player.h"

Player player(10, 20);

TEST(EntityTest, moveTo)
{
	player.moveTo(sf::Vector2f(50, 0));
	EXPECT_EQ(player.getPosition(), sf::Vector2f(50, 0));
}

TEST(EntityTest, translate)
{
	player.translate(sf::Vector2f(-50, 20));
	EXPECT_EQ(player.getPosition(), sf::Vector2f(0, 20));
}

TEST(EntityTest, setSpeed)
{
	player.setSpeed(sf::Vector2f(10, 10));

	EXPECT_EQ(player.getSpeed(), sf::Vector2f(10, 10));
}

TEST(EntityTest, incSpeed)
{
	player.incSpeed(sf::Vector2f(10, 10));
	EXPECT_EQ(player.getSpeed(), sf::Vector2f(20, 20));
}


TEST(PlayerTest, health)
{
	player.hit(50);
	EXPECT_EQ(player.getHealth(), 50);
	player.hit(500);
	EXPECT_EQ(player.getHealth(), 0);
}